<style>
.weui_cells_title{font-weight: bold;margin-top:0.3rem}
</style>
<div class="fui-page order-create-page fui-page-current" ng-if="pagedata.op == 'detail'">
	<div class="fui-content" style="padding-bottom:5rem">
		<div id="carousel-container" class="carousel slide" data-role="carousel" data-param-auto="true">
			<div class="carousel-inner" role="listbox" style="height:auto">
			<div ng-class="{'item':1,'active':$index==0}" ng-repeat="pic in pagedata.item.hdp">
				<img ng-src="{{tomedia(pic)}}" style="display: block; width: 100%; height: 100%;">
			</div>
			</div>
			<style>
					.fui-swipe-page .fui-swipe-bullet {background: {background}; opacity: {opacity};}
					.fui-swipe-page .fui-swipe-bullet.active {opacity: 1;}
			</style>
			<div id="carousel-jinyun" class="fui-swipe-page" style="padding: 0 5px; bottom: 10px; ">
				<div class="fui-swipe-bullet" ng-repeat="item in pagedata.item.hdp" ng-class="{'active':$index==0}" data-target="#carousel-container" data-slide-to="{{$index}}"></div>
			</div>
		</div>
		<video ng-if="pagedata.item.video" style="width:100%;max-height:20rem" ng-src="{{tomedia(pagedata.item.video)}}" ng-poster="{{tomedia(pagedata.goods.image)}}" x5-playsinline="" playsinline="" webkit-playsinline="" preload="auto"  preload="auto" controls loop="loop">
		</video>
		<div id="baoming" style="padding:0 0.5rem;">
			<div class="fui-cell-group" style="margin-top:0.5rem">
				<div class="fui-cell must">
					<div class="fui-cell-label bold">您的姓名</div>
					<div class="fui-cell-info">
						<input type="text" placeholder="{{pagedata.post.oldname2||'请输入您的姓名'}}" class="fui-input" ng-model="pagedata.post.name"/>
					</div>
				</div>
				<div class="fui-cell must">
					<div class="fui-cell-label bold">您的电话</div>
					<div class="fui-cell-info">
						<input type="text" placeholder="{{pagedata.post.oldmobile2||'请输入您的电话'}}" class="fui-input" ng-model="pagedata.post.mobile"/>
					</div>
				</div>
				<div ng-if="pagedata.post.diyfields.length>0" style="padding-bottom:0.5rem">
					<div ng-include="sys_html('common/_diyform',true)"></div>
				</div>
				<div class="fui-cell" ng-if="pagedata.xieyi.noxieyi!=1">
				<div class="fui-cell-info">
					<label class="checkbox-inline" style="font-size:0.6rem;padding-bottom:0;line-height:0.8rem">
						<input type="checkbox" value="1" ng-model="pagedata.post.check" class="fui-checkbox-primary" id="agree" ng-checked="pagedata.post.check==1"/>
						下次自动填写，阅读并同意
						<a id="btn-apply" ng-click="pagedata.show_xieyi=true;;pagedata.show_type=1" style="color:#337ab7;">《授权书》</a>
					</label>
				</div>
				</div>
			</div>
		</div>
		<div ng-if="pagedata.isend!=1 && pagedata.ismannum!=1" class="weui_btn_area" style="margin:1rem 0.6rem">
			 <a ng-if="pagedata.post.money>0 && !pagedata.order_id" class="weui_btn weui_btn_primary bold" style="font-size:0.8rem;border-radius:1rem;line-height:2.7;background:{{pagedata.pluginset.syscolor}}" href="javascript:" ng-click="pagedata.pay_submit(pagedata.post,'jy_adbaoming/detail/notice/','jy_adbaoming/order//status=2')">
				<i class="icon icon-bianji"></i> 
				<span class="text-danger bigprice">￥
					<span class="totalprice" style="font-size:1.2rem">{{price(pagedata.post.money) || '0.00'}}</span>
				</span>
				{{pagedata.item.btntitle||'立即报名'}}
			 </a>
			 <a ng-if="pagedata.post.money>0 && pagedata.order_id" class="weui_btn weui_btn_primary bold" style="font-size:0.8rem;border-radius:1rem;line-height:2.7;background:{{pagedata.pluginset.syscolor}}" href="javascript:" ng-click="access_json('jy_adbaoming/order/')">
				<i class="icon icon-bianji"></i> 查看报名
			 </a>
			 <a ng-if="pagedata.post.money<=0" class="weui_btn weui_btn_primary bold" style="font-size:0.8rem;border-radius:1rem;line-height:2.7;background:{{pagedata.pluginset.syscolor}}" href="javascript:" ng-click="post(pagedata.post,'jy_adbaoming/detail/notice/')">
				<i class="icon icon-bianji"></i> {{pagedata.item.btntitle||'立即报名'}}
			 </a>
		</div>
		<div ng-if="pagedata.isend==1 || pagedata.ismannum==1" class="weui_btn_area" style="margin:1rem 0.6rem">
			 <a class="weui_btn weui_btn_primary bold" style="font-size:0.8rem;border-radius:1rem;line-height:2.7;background:#ddd">
				<i class="icon icon-bianji"></i> {{pagedata.notitle ||'无法报名'}}
			 </a>
		</div>
		<div ng-repeat="pic in pagedata.item.remark" style="margin-top:0.5rem;height:auto;width: 100%;">
			<img style="width: 100%;height:auto" ng-src="{{tomedia(pic)}}"/>
		</div>
		<div ng-if="pagedata.item.content" style="padding:0.4rem 0.5rem;">
			<div class="content-block content-images" ng-bind-html="trust(pagedata.item.content)"></div>
		</div>
		<div ng-include="sys_html('common/_copyright',true)"></div>
</div>
<div ng-if="pagedata.xieyi.noxieyi2!=1" class="fui-navbar-tip c" style="color:#999;background:#f2f2f2">
{{pagedata.item.organize || pagedata.account.title}} | <a ng-click="pagedata.show_xieyi=true;pagedata.show_type=2" style="color:#337ab7;">《个人信息保护申明》</a>
</div>
<div ng-if="pagedata.isend!=1 && pagedata.ismannum!=1" class="fui-navbar sysbgcolor c" style="height:2.5rem;background:{{pagedata.pluginset.syscolor}}">
	<a href="javascript:;" ng-click="pagedata.gotoid();" style="font-size:0.8rem;line-height:2.5rem;color:#fff"><i class="icon icon-bianji"></i> {{pagedata.item.btntitle||'立即报名'}}</a>
</div>
<div ng-if="pagedata.isend==1 || pagedata.ismannum==1" class="fui-navbar sysbgcolor c" style="height:2.5rem;;background:#ddd">
	<a style="font-size:0.8rem;line-height:2.5rem;color:#fff"><i class="icon icon-bianji"></i> {{pagedata.notitle ||'无法报名'}}</a>
</div>
<div ng-if="pagedata.show_xieyi" class="popup">
		<div class="popup-body">
			<div class="popup-center">
				<i class="closed icon icon-cuowu" ng-click="pagedata.show_xieyi=false"></i>
				<div class="content-images" style="padding:0.5rem;height:20rem; overflow-y:scroll;">
						<div class="title bold" style="font-size:0.8rem">{{pagedata.show_type!=2?'授权书':'个人信息保护申明'}} / <small>Read Ggree</small></div>
						<div ng-if="pagedata.show_type!=2" class="text" style="padding-top:0.5rem;font-size:0.7rem" ng-bind-html="trust(pagedata.xieyi.content)">
						</div>
						<div ng-if="pagedata.show_type==2" class="text" style="padding-top:0.5rem;font-size:0.7rem" ng-bind-html="trust(pagedata.xieyi.content2)">
						</div>
				</div>
				<div ng-if="pagedata.show_type!=2" class="modal-footer">
					<div ng-click="pagedata.show_xieyi=false;pagedata.post.check=1;" class="mod-check" style="width: 100%; margin: 0;">我已阅读</div>
				</div>
			</div>
		</div>
</div>
<script>
	require(['bootstrap', 'hammer'], function($, Hammer){
		$('#carousel-container').carousel();
		var mc = new Hammer($('#carousel-container').get(0));
		mc.on("panleft", function(ev) {
			$('#carousel-container').carousel('next');
		});
		mc.on("panright", function(ev) {
			$('#carousel-container').carousel('prev');
		});
	});
</script>
<script type="text/javascript">
scope.pagedata.check_buy=function(){
	var itemid=scope.pagedata.item.id
	scope.get('jy_adbaoming/detail/check_buy/itemid='+itemid,function(res){});
}
scope.pagedata.gotoid=function(){
	setTimeout(function(){
		var element = document.getElementById('baoming');
		element.scrollIntoView();
		element.scrollIntoView(false);
		element.scrollIntoView({block: "start"});
		element.scrollIntoView({behavior: "smooth", block: "start", inline: "nearest"});
	},200);
}
scope.pagedata.pay_submit=function(post,post_url,complete_url){
	scope.post_json(post_url,post,function(result){
		if(result.order_id){
			scope.pagedata.order_id=result.order_id;
			scope.$evalAsync();
			scope.tool.pay(result.pay_id,function(res){
					if(res.type=='success'){
						scope.message('支付成功！','success',complete_url);
					}else{
						scope.message('支付失败！','success',complete_url);
					}
			},'','',complete_url,complete_url);
		}
	});
}
</script>
</div>